package blurTest;

import processing.core.PApplet;



import processing.core.PApplet;
import processing.core.PFont;
import processing.core.PGraphics;
import circus.ProjectionMapper;
import controlP5.ControlEvent;
import processing.opengl.*;
import proxml.*;
import controlP5.*;
import circus.*;

public class BlurTest extends PApplet {
	
	PFont font;
	PGraphics p;

	ProjectionMapper mapper;

	public void setup() {
		size(1280, 960, P3D);
		mapper = new ProjectionMapper(this, "projection", 1, 1);

		noStroke();
		smooth();

		font = createFont("Calluna-It",48);
	}

	public void draw() {
		System.out.println(frameRate);
		String textString = "Oh my God it,s Technomusic";

		background(0);

		textSize(48);
		textFont (font);

		/* p = createGraphics((int)textWidth(textString)+150,(int)(textDescent()+textAscent()+50),P3D);
		p = createGraphics(96,48,P3D);
		p.beginDraw();
		p.background(100,0);
		p.textSize(48);
		p.textFont (font);
		p.fill(255);
		p.text (textString, 50,50);
		p.filter(BLUR,6);
		p.endDraw();
		image(p,mapper.shapeWidth(1)/2, mapper.shapeHeight(1)/2);*/

		textUnten();
		textUnten2();
		textOben();
		}
	
	void textUnten() {
		 String textString = "Oh my God it,s Technomusic";
		 fill(255);
		 text(textString,mapper.shapeWidth(1)/2-200, (mapper.shapeHeight(1)/2));
		 filter(BLUR,7);
		  
		 mapper.textures[1] = get();
	}

	void textUnten2() {
		 String textString = "Oh my God it,s Technomusic";
		 fill(255, 225, 35);
		 text(textString,mapper.shapeWidth(1)/2-200, (mapper.shapeHeight(1)/2));
		 filter(BLUR,4);
		  
		 mapper.textures[1] = get();
	}

	void textOben() {
		 String textString = "Oh my God it,s Technomusic";
		 fill(255);
		 text(textString,mapper.shapeWidth(1)/2-198, (mapper.shapeHeight(1)/2)-2);

		 mapper.textures[1] = get();
		 background(255);
	}

	void controlEvent(ControlEvent theEvent) {
		 mapper.controlEvent(theEvent);
	}
	
	
	static public void main(String args[]) {
	    PApplet.main(new String[] {blurTest.BlurTest.class.getName() });
	}
}